﻿using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Text;

namespace Helpers.Repository
{
    [Obsolete("请使用MongoRepository")]
    public abstract class TransientMongoRepository<T> : MongoRepository<T>, ITransientMongoRepository where T : IMongoEntity
    {
        public TransientMongoRepository(IMongoDatabase mongoDatabase) : base(mongoDatabase)
        {
        }

        public TransientMongoRepository(IMongoClient mongoClient, string databaseName) : base(mongoClient, databaseName)
        {
        }

        public TransientMongoRepository(IMongoDatabase mongoDatabase, string collectionName) : base(mongoDatabase, collectionName)
        {
        }

        public TransientMongoRepository(IMongoClient mongoClient, string databaseName, string collectionName) : base(mongoClient, databaseName, collectionName)
        {
        }

        /// <summary>
        /// 必须赋值基类的GetCollectionName,可以根据_collectionName来分表
        /// </summary>
        /// <param name="configure"></param>
        public abstract void SetCollectionName(Func<string> configure);
    }
}
